﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using DBA.Data;
using DBA.Data.ADO;

namespace Demo
{
    public partial class WebForm1 : BasePage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (IsPostBack) return;
                BindGridData();
        }

        protected void BindGridData()
        {
            string strSelect = "(select * from tbSysUsers)";

            //DalAdo.ManagerParameter.AddNewInParameter("ActionID", Convert.ToDecimal(userCode));
            //System.Data.DataTable dt = DalAdo.ExecuteFillDataTable(strSelect);

            //dt = DalAdo.ModifyData.GetPageDataTable(
            DataTable dt = new DataTable();
            int count = 0;
            //dt = DalAdo.ModifyData.GetPageDataTable(strSelect, "*", "", "UserGuid", 2, 20, DAL.ADO.Data.ManagerSQL.PageViewTableType.MixtureTable, ref count);
            dt = ado.ModifyData.GetPageDataTable("tbsysusers", "*", "", "UserGuid", 1, 10, ManagerSQL.PageViewTableType.SimpleTable, ref count);
            GridView1.DataSource = dt;
            GridView1.DataBind();

        }

        protected void btn_Logon_Click(object sender, EventArgs e)
        {
            //用户登陆 
            string RoleName = this.txt_RoleName.Text;
            string RoleNote = this.txt_RoleNote.Text;

            ado.ManagerParameter.AddNewInParameter("ROLEGUID", Convert.ToDecimal(101));

            ado.ManagerParameter.AddNewInParameter("ROLENAME", RoleName);

            ado.ManagerParameter.AddNewInParameter("ROLENOTE", RoleNote);


            ado.ModifyData.Insert("sys_role");

            string error = ado.ErrorMessage;


        }
    }
}